<template>
    <div>
        <van-nav-bar title="标题" left-text="返回" left-arrow @click-left="()=>{$router.back()}" fixed/>
            <div style="height: 45px;"></div>
            <div v-html="wgq.goods_introduce"></div>
        <van-action-bar>
            <van-action-bar-icon icon="chat-o" text="客服" color="#ee0a24" />
            <van-action-bar-icon icon="cart-o" text="购物车" />
            <van-action-bar-icon icon="star" text="已收藏" color="#ff5000" />
            <van-action-bar-button type="warning" text="加入购物车" @click="dj"/>
            <van-action-bar-button type="danger" text="立即购买" />
        </van-action-bar>
    </div>
</template>

<script setup>
import {ref}from 'vue'
import {detailApi}from '@/api/api'
import router from '@/router'
import { useRoute } from 'vue-router'
let route=useRoute()
let wgq=ref([])
detailApi(route.params.goods_id).then(res=>{
    console.log('详情页',res)
    wgq.value=res.data.message
})
import { useCounterStore } from '@/stores/counter'
// 可以在组件中的任意位置访问 `store` 变量 ✨
const store = useCounterStore()

let dj=()=>{
    store.shopcar(wgq,route.params.goods_id)
    router.push('/wgq1/wgq4')
}
</script>

<style lang="scss" scoped></style>